<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    table {
      border: 1px solid #333;
      border-collapse: collapse;
    }
    td {
      border: 1px solid #333;
    }
  </style>
</head>
<body>
  <script>
    function createTable () {
      var str = '<table>'
      for (var i = 0; i < 5; i++) {
        str += '<tr>'
        for (var j = 0; j < 6; j++) {
          str += '<td>11</td>'
        }
        str += '</tr>'
      }
      str += '</table>'
      document.write(str)
    }
    // 多次调用函数实现代码复用
    createTable()
    createTable()
    createTable()

  </script>
</body>
</html>